import moment, {Moment} from "moment";

export function showTime(timeStr: string | Date | Moment | number, formatType: string = "YYYY-MM-DD HH:mm:ss") {
    if (!timeStr) {
        return "";
    }
    if (typeof (timeStr as Moment).format === "function") {
        return (timeStr as Moment).format(formatType);
    }
    return moment(timeStr).format(formatType);
}
